home *** CD-ROM | disk | FTP | other *** search
- class CCircle extends CCollisionVolume
- {
- var m_body;
- var m_radius = 1;
- var m_radiusSquared = 1;
- function CCircle(body, radius)
- {
- super(body);
- this._radius = radius;
- }
- function get _center()
- {
- return this.m_body._location;
- }
- function get _boundingRadius()
- {
- return this.m_radius;
- }
- function get _radius()
- {
- return this.m_radius;
- }
- function set _radius(r)
- {
- this.m_radius = r;
- this.m_radiusSquared = r * r;
- }
- function get _topLeftCorner()
- {
- return this.m_body._location.GetSubtractScalar(this.m_radius);
- }
- function get _bottomRightCorner()
- {
- return this.m_body._location.GetAddScalar(this.m_radius);
- }
- }
-